package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.SysAskpMapper;
import com.ruoyi.system.mapper.SysBiddingMapper;
import com.ruoyi.system.mapper.SysManagementMapper;
import com.ruoyi.system.mapper.SysManagementProcessMapper;
import com.ruoyi.system.service.ISysManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author ：zhaoguanyu
 * @Date ：Created in 2022/1/17 14:32
 */
@Service
public class SysManagementServiceImpl implements ISysManagementService {

    @Autowired
    private SysManagementMapper sysManagementMapper;

    @Autowired
    private SysAskpMapper sysAskpMapper;

    @Autowired
    private SysBiddingMapper sysBiddingMapper;

    @Autowired
    private SysManagementProcessMapper sysManagementProcessMapper;

    /**
     * 获取提交招标申请
     *
     * @param itemNo 项目编号
     * @return 结果
     */
    @Override
    public List<SysManagement> selectDocumentList(String itemNo) {
        List<SysManagement> list = sysManagementMapper.selectDocumentList(itemNo);
        return list;

    }

    /**
     * 询价文件确认-会议通知
     *
     * @param itemNo 项目编号
     * @return 结果
     */
    @Override
    public List<SysAskp> selectMeeting(String itemNo) {
        List<SysAskp> list = sysAskpMapper.selectMeeting(itemNo);
        return list;
    }


    /**
     * 询价文件确认-询价文件确认
     *
     * @param itemNo 项目编号
     * @return 结果
     */
    @Override
    public List<SysAskp> selectAskPriceFile(String itemNo) {
        List<SysAskp> list = sysAskpMapper.selectAskPriceFile(itemNo);
        return list;
    }

    /**
     * 招标-发出招标文件
     *
     * @param itemNo 项目编号
     * @return 结果
     */
    @Override
    public List<SysBidding> selectBiddingFile(String itemNo) {
        List<SysBidding> list = sysBiddingMapper.selectAskPriceFile(itemNo);
        return list;
    }

    /**
     * 招标-会议通知
     *
     * @param itemNo 项目编号
     * @return 结果
     */
    @Override
    public List<SysBidding> selectBiddingMeeting(String itemNo) {
        List<SysBidding> list = sysBiddingMapper.selectBiddingMeeting(itemNo);
        return list;
    }

    /**
     * 招标-提交用印申请审批表/评审报告审批表
     *
     * @param itemNo 项目编号
     * @return 结果
     */
    @Override
    public List<SysBidding> selectBiddingAssess(String itemNo) {
        List<SysBidding> list = sysBiddingMapper.selectBiddingAssess(itemNo);
        return list;
    }

    @Override
    public int updateProjectManager(SysManagementProcess sysManagementProcess) {
        return sysManagementProcessMapper.updateInformation(sysManagementProcess);
    }

    @Override
    public List<SysBidding> getProgress(String itemNo) {
        List<SysBidding> list = sysManagementProcessMapper.getProgress(itemNo);
        return list;
    }


}
